<%--
  Created by IntelliJ IDEA.
  User: css
  Date: 2018/7/5
  Time: 15:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="css/bootstrap.css" />
</head>
<body>
<div class="section_div"  style="width: 1000px; margin: 0 auto; padding-top: 40px;">
    <form action="${pageContext.request.contextPath}/findUsers" method="post">
        <label>查询员工信息：</label>
        <select name="sid">
            <c:forEach items="${sessionScope.sections}" var="section">
                <c:if test="${section.sname!='BOSS'}">
                    <option value="${section.sid}">${section.sname}</option>
                </c:if>
            </c:forEach>
        </select>&nbsp;&nbsp;&nbsp;
        <label>选择排序方式：</label>
        <select name="att">
            <option value="name">name</option>
            <option value="startDate">startData</option>
            <option value="salary">salary</option>

        </select>
        <select name="order">
            <option value="DESC">升序</option>
            <option value="ASC">降序</option>
        </select>
        <button type="submit" class="btn btn-info">查询</button>
    </form>
    <table class="table table-striped table-bordered table-hover table-condensed">
        <c:if test="${!empty requestScope.users}">
            <tr>
                <th>入职时间</th>
                <th>姓名</th>
                <th>性别</th>
                <th>部门</th>
                <th>邮箱</th>
                <th>电话</th>
                <th>薪水</th>
                <th>修改信息</th>
                <th>生成工资单</th>
            </tr>
            <c:forEach items="${requestScope.users}" var="us">
                <tr>
                    <td>${us.startDate}</td>
                    <td>${us.name}</td>
                    <c:if test="${us.sex=='1'}">
                        <td>男</td>
                    </c:if>
                    <c:if test="${us.sex=='2'}">
                        <td>女</td>
                    </c:if>
                    <td>${us.section.sname}</td>
                    <td>${us.email}</td>
                    <td>${us.telephone}</td>
                    <td>${us.salary}</td>
                    <td><a href="oparatorAndShow?uid=${us.uid}">修改</a></td>
                    <td><a href="showSalaryTable?uid=${us.uid}">工资单</a></td>
                </tr>
            </c:forEach>
        </c:if>
    </table>
</div>
</body>
</html>

